import * as actionTypes from './actionTypes'

const reducer = (state = {tasks: []}, action) => {
    switch(action.type) {
        case actionTypes.ADDTASK:
            return {
                ...state,
                tasks: state.tasks.concat(action.task),
            };
        default: 
            return state;    
    }
}

export default reducer;